function BannerAction(selector){
	this.ele = $(selector).get(0);
	this.count = 1;
	this.liWidth = -$(this.ele).find('.slider li').width();
	this.btn();
	this.timer = setInterval(this.timerAction.bind(this),2000)
}

BannerAction.prototype.timerAction = function(){
	this.count++;
	this.change();
}

BannerAction.prototype.icon = function(){
	var oSelf = this;
	$(oSelf.ele).children('.sliderIcon li').on({
		click:function(){
			oSelf.count = $(this).index()+1;
			oSelf.change();
		}
	})
}

BannerAction.prototype.btn = function(){
	var oSelf = this;
	$(oSelf.ele).children('.btn').on({
		click:function(){
			$(this).hasClass('left')? --oSelf.count : ++oSelf.count;
			oSelf.change();
		}
	})
}
BannerAction.prototype.change = function(){
	var oSelf = this;
	var length = $(oSelf.ele).find('.slider li').size();
	if(oSelf.count==0){
		$(oSelf.ele).children('.slider').css({
			'left':oSelf.liWidth*length-1
		})
		oSelf.count= length-2;
	}else if(oSelf.count==length-1){
		$(oSelf.ele).children('.slider').css({
			'left':0
		})
		oSelf.count = 1;
	}
	console.log($(oSelf.ele).children('.slider').width())
	$(oSelf.ele).children('.slider').stop().animate({
		left:oSelf.count*oSelf.liWidth
	})
	$(oSelf.ele).find('.sliderIcon li').eq(oSelf.count-1).addClass('icColor').siblings().removeClass();
}
